<div class="group-category">
  <div class="col-md-4">
    <div class="group-title">请选择行业类目</div>
    <div class="group-item">
      <ul class="list-unstyled">
        <li *ngFor="let item of oneCategoryList" [ngClass]="{'active': nowOneCategory?.id === item.id}" (click)="selectNowCategory(item)">{{item.name}}</li>
      </ul>
    </div>
  </div>
  <div class="col-md-4">
    <div class="group-title">请选择次级类目</div>
    <div class="group-item">
      <ul class="list-unstyled">
        <li *ngFor="let item of twoCategoryList" [ngClass]="{'active': nowTwoCategory?.id === item.id}" (click)="selectNowCategory(item)">{{item.name}}</li>
      </ul>
    </div>
  </div>
  <div class="col-md-4">
    <div class="group-title">请选择单品分类</div>
    <div class="group-item">
      <ul class="list-unstyled">
        <li *ngFor="let item of threeCategoryList" [ngClass]="{'active': nowThreeCategory?.id === item.id}" (click)="selectNowCategory(item)"><!--{{item.id}}-->{{item.name}}</li>
      </ul>
    </div>
  </div>
</div>

<div class="loading" *ngIf="loadingShow">
  <app-loading></app-loading>
</div>



<div *ngIf="!loadingShow && attributeListShow">

  <div class="row">
    <div class="form-title">已绑定属性</div>
    <!--{{goodsAttribute|json}}-->
    <div class="col-md-10">
    <span *ngFor="let item of goodsAttribute">
      <div class="col-md-4"  *ngIf="item.bind==true">
          {{item.name}}：
        <select name="" class="form-control width-control">
          <option value="" *ngFor="let ite of item.child">{{ite.value}}</option>
        </select>
      </div>
    </span>
    </div>
  </div>

  <div class="row">
    <div class="form-title">属性集</div>
    <div class="col-md-10" *ngIf="nowTwoCategory">
      <div class="col-md-2" *ngFor="let item of goodsAttribute"><label style="font-weight: normal"><input type="radio" name="attr" (click)="selectGoodsAttribute(item)"><!--{{item.id}}-->{{item.name}}<!--[{{item.bind}}]{{item.goods_attribute_set_id}}--></label></div>
    </div>
  </div>

  <div class="row">
    <div class="form-title">属性集选项</div>
    <div class="col-md-10" *ngIf="nowGoodsAttribute">
      <div class="col-md-2"><label style="font-weight: normal"><input type="radio" name="choose" [checked]="nowGoodsAttribute?.multiple_choice==='单选'" (click)="choice('单选')">单选</label></div>
      <div class="col-md-2"><label style="font-weight: normal"><input type="radio" name="choose" [checked]="nowGoodsAttribute?.multiple_choice==='多选'" (click)="choice('多选')" >多选</label></div>
    </div>
  </div>

  <div class="row">
    <div class="form-title">请选择属性值　
      <button *ngIf="goodsAttributeValue.length>0" (click)="selectGoodsAttributeValueAll()">全选</button>
      <button *ngIf="goodsAttributeValue.length>0" (click)="selectGoodsAttributeValueAllCancel()">取消</button>

    </div>
    <div class="col-md-10">
      <div class="col-md-2" *ngFor="let item of goodsAttributeValue;let i = index">
        <!--<label style="font-weight: normal" *ngIf="nowGoodsAttribute?.multiple_choice=='单选'">
          <input type="radio" value="{{item.id}}" name="type" [checked]="item.bind===true" (click)="selectRadioGoodsAttributeValue(item)" >&lt;!&ndash;{{item.id}}&ndash;&gt;{{item.value}}&lt;!&ndash;[{{item.bind}}]{{item.goods_attribute_set_value_id}}&ndash;&gt;
        </label>-->
        <label style="font-weight: normal">
          <input type="checkbox" value="{{item.id}}" (click)="selectGoodsAttributeValue(item)" [checked]="item.bind"  [(ngModel)]="item.bind"><!--{{item.id}}-->{{item.value}}<!--[{{item.bind}}]{{item.goods_attribute_set_value_id}}-->
        </label>
      </div>
    </div>
  </div>
</div>


<div class="operate-line">
  <button class="btn btn-default" *ngIf="nowGoodsAttribute?.goods_attribute_set_id" (click)="goodsAttributeSetDel()">取消此属性集</button>
  <button class="btn btn-default" *ngIf="nowGoodsAttribute" (click)="bindGoodsAttributeSetAndSetValue()">添加此属性集</button>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow" (promptIsShow)="promptIsShow($event)"></app-notification>

